<template>
	<view class="container">
		<web-view :src="web_url" v-if="web_url"></web-view>
	</view>
</template>

<script>
	var _this;
	export default {
		data() {
			return {
				web_url:'',
			}
		},
		onLoad(option) {
			_this=this
			var serial = option.serial
			if(!serial){
				uni.$u.toast('提交参数有误')
				this.$u.route({
					type: "back"
				})
				return false;
			}
			this.getMonitorDetail(serial)
		},
		methods: {
			async getMonitorDetail(serial){
				const params={serial}
				const data = await _this.$post('api/get_monitor_detail',params)
				if (data.code==200) {
					this.web_url=data.data.url
				}else{
					uni.$u.toast(data.msg)
					setTimeout(()=>{
						uni.navigateBack()
					},2000)
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{}
</style>